package com.itheima.dao;

import com.itheima.domain.QueryByGender;
import com.itheima.domain.Role;
import com.itheima.domain.TurnPage;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Select;

import java.io.IOException;
import java.util.List;

public interface RoleMapper {

    @Select("select * from role_table")
    public List<Role> findAll() throws IOException;

    @Select("select * from role_table limit #{startIndex},#{pageSize}")
    public List<Role> turnPages(TurnPage turnPage);

    @Select("select * from role_table where gender=#{gender} limit #{startIndex},#{pageSize}")
    public List<Role> findByGender(QueryByGender queryByGender);

    @Select("select * from role_table where id=#{id}")
    public List<Role> findById(int id);

    @Select("select * from role_table order by salary desc limit #{startIndex},#{pageSize}")
    public List<Role> RankBySalary(TurnPage turnPage);

    @Select("Select count(id) from role_table")
    public int countId();

    @Select("Select count(id) from role_table where gender=#{gender}")
    public int countGender(String gender);


}
